Refresh in-memory Client after sign-out and add tests#587
Refresh in-memory Client after sign-out and add tests#587
Conversation
Perform a best-effort Client.getSkippingClientId() refresh after local sign-out cleanup so stale in-progress sign-in/sign-up state does not persist across remounts.\n\nAlso expands SignOutService tests to mock ClientApi and assert the refresh call occurs and failures are tolerated.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a best-effort client state refresh to the sign-out flow: after local sign-out cleanup (device token deletion and Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Exposes the device token through the SDK's encrypted storage layer so external consumers (e.g. the Expo bridge) can read it without bypassing StorageCipher. Direct SharedPreferences reads break after the storage encryption change in #585.
- Bump clerk-android to 1.0.11 which handles Client.getSkippingClientId() in SignOutService.signOut() (clerk/clerk-android#587) - Remove our bridge-level getSkippingClientId() calls (now redundant) - Use Clerk.getDeviceToken() instead of raw SharedPreferences read for getClientToken(), fixing compatibility with encrypted storage in 1.0.11
Motivation
Clientwhile skipping the current client id.Description
SignOutService.signOut()by invokingClient.getSkippingClientId()inside thefinallyblock and logging failures.Clientand perform the refresh viarunCatching { Client.getSkippingClientId() }to avoid breaking sign-out flow on refresh errors.ClerkApi.clientandClientApi.getSkippingClientId()and update existing sign-out tests to include the client refresh expectation.signOut refreshes client after local sign-out cleanupandsignOut tolerates client refresh failurewhich verify the client refresh is called and that refresh failures are tolerated.Testing
SignOutServiceTestsuite including the two new testssignOut refreshes client after local sign-out cleanupandsignOut tolerates client refresh failure, and all tests passed.ClientApi.getSkippingClientId()and passed successfully.SignOutService.signOut()returnsClerkResult.Successon normal flows and still clears local state when server sign-out or client refresh fails.Codex Task